<?xml version="1.0" encoding="UTF-8"?>
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:jwork="http://irian.at/jsfatwork">

<ui:composition template="/templates/template.xhtml">
    <ui:define name="heading">Login</ui:define>
    <ui:define name="content">

        <div>
            <h:outputText value="Welcome to JSF@Work - please login" rendered="#{authorizationBean.normalLogin}"/>
            <h:outputText value="Login failed - wrong username or password" rendered="#{authorizationBean.loginFailure}"/>
            <h:outputText value="You are logged out - thanks for using JSF@Work" rendered="#{authorizationBean.afterLogout}"/>
            <p/>
        </div>

        <div>
            <div>
                <input type="text"     name="j_username" id="username" value="username" onfocus="this.value=''"/>
            </div>
            <div>
                <input type="text"     name="not_used"   id="not_used" value="password" onfocus="switchPasswordFields(this);"/>
                <input type="password" name="j_password" id="password" value="" style="display:none"/>
            </div>
            <div>
                <input type="submit" value="Login"
                            onclick="document.forms['mainForm'].action='../j_spring_security_check';
                            return true;"/>
                <script type="text/javascript">
                    function switchPasswordFields (pwDisplay) {
                        pwDisplay.style.display = "none";
                        var pwEmpty = document.getElementById("password");
                        pwEmpty.style.display = "inline";
                        pwEmpty.focus();
                        return true;
                    }
                </script>
            </div>
        </div>

    </ui:define>
</ui:composition>

</html>